package com.lang.generator.controller;

import cn.lang.global.ret.Ret;
import com.lang.generator.domain.dto.TemplateResultDto;
import com.lang.generator.service.TemplateService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 模板控制器
 *
 * @author zhangren
 * @date 2022/12/13
 */
@Api("模板")
@RequestMapping("/template")
@RestController
public class TemplateController {

    @Resource
    private TemplateService templateService;

    @GetMapping("/list")
    public Ret<List<TemplateResultDto>> getTemplates() {
        return Ret.success(templateService.getTemplateList());
    }

}
